package com.nbsaas.boot.evaluate.rest.resource;

import com.nbsaas.boot.evaluate.api.apis.EvaluateFileApi;
import com.nbsaas.boot.entity.evaluate.EvaluateFile;
import com.nbsaas.boot.evaluate.api.domain.request.EvaluateFileRequest;
import com.nbsaas.boot.evaluate.api.domain.response.EvaluateFileResponse;
import com.nbsaas.boot.evaluate.api.domain.simple.EvaluateFileSimple;
import com.nbsaas.boot.evaluate.rest.convert.EvaluateFileSimpleConvert;
import com.nbsaas.boot.evaluate.rest.convert.EvaluateFileEntityConvert;
import com.nbsaas.boot.evaluate.rest.convert.EvaluateFileResponseConvert;
import com.nbsaas.boot.evaluate.data.repository.EvaluateFileRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   评价文件-业务接口实现
*/
@Transactional
@Service
public class EvaluateFileResource extends BaseResource<EvaluateFile,EvaluateFileResponse, EvaluateFileSimple, EvaluateFileRequest>  implements EvaluateFileApi {

    @Resource
    private EvaluateFileRepository evaluateFileRepository;

    @Override
    public JpaRepositoryImplementation<EvaluateFile, Serializable> getJpaRepository() {
        return evaluateFileRepository;
    }

    @Override
    public Function<EvaluateFile, EvaluateFileSimple> getConvertSimple() {
        return new EvaluateFileSimpleConvert();
    }

    @Override
    public Function<EvaluateFileRequest, EvaluateFile> getConvertForm() {
        return new EvaluateFileEntityConvert();
    }

    @Override
    public Function<EvaluateFile, EvaluateFileResponse> getConvertResponse() {
        return new EvaluateFileResponseConvert();
    }




}


